#ifndef FIGSTACK_H
#define FIGSTACK_H 1

#define MAXLEN_FIG      128

/* Struct to store figure names, and each
 * figure's properties. */
struct Properties  {
    char figureName[MAXLEN_FIG+1];

    double x, y;
    double *dx, *dy;
    
    int drawCount;
    int isdefined;
};

typedef struct {
    struct Properties * figProperties;

    int currSize;
    int figureCount;
} FigStack;


extern int figureCount;

/* FUNCTION PROTOTYPES */

void initstack ( FigStack * Figures, int length );

void addFig ( FigStack * Figures, char * localFigName );

/* Initializes a figure. */
void initfig ( FigStack * Figures, char * figName );

/* Updates information in Figures using parameters found in string. */
void updatefig ( char * string, FigStack * Figures, int position, int type );

void plusOneDraw ( FigStack * Figures, int position );

/* Retrieves the index of nameString inside Figures. */
int getFigIndex ( char * nameString, FigStack * Figures );

/* Finds if nameString exists inside Figures structure. */
int figexists ( char * nameString, FigStack * Figures );

/* Resets memory in Figures at position to reset. */
void clearfig ( FigStack * Figures, int position, double reset );

void extendFigStack ( FigStack * Figures );

#endif /* End of include guard: FIGSTACK_H */
